package com.hashmap1;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class TestMap2 {
public static void main(String[] args) {
	Map<Integer, String> map=new HashMap<Integer, String>();
	map.put(2, "deepak");
	map.put(1, "amit");
	map.put(8, "nagesh");
	map.put(3, "raj");
	Iterator<Map.Entry<Integer, String>> iterator=map.entrySet().iterator();
	while(iterator.hasNext()){
		Map.Entry<Integer, String> entry=iterator.next();
		System.out.println(entry.getKey()+"\t"+entry.getValue());
		iterator.remove();
	}
	System.out.println(map.size());
}
}
